package com.jyw.router.hospital.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.jyw.router.hospital.domain.dto.HospitalRegisterDto;
import lombok.Data;
import lombok.experimental.FieldNameConstants;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.jyw.router.common.annotation.Excel;
import com.jyw.router.common.core.domain.BaseEntity;

import java.time.LocalDate;
import java.time.LocalDateTime;

/**
 * 医院服务信息对象 r_hospital_info
 * 
 * @author shenjun
 * @date 2023-04-10
 */
@Data
@TableName("r_hospital_info")
@FieldNameConstants
public class HospitalInfo
{
    private static final long serialVersionUID = 1L;

    /** 主键 */
    @TableId(type = IdType.AUTO)
    private Long id;

    /** 服务公钥 */
    @Excel(name = "服务公钥")
    private String serverKey;

    /** 服务私钥 */
    @Excel(name = "服务私钥")
    private String serverSecret;

    /** 服务名称 */
    @Excel(name = "服务名称")
    private String serverName;

    /** 服务路由地址 */
    @Excel(name = "服务路由地址")
    private String serverUrl;

    /** 数据有效性1有效 0无效 */
    @Excel(name = "数据有效性1有效 0无效")
    private Integer recordState;

    private LocalDateTime createTime;

    public HospitalRegisterDto buildDto(){
        HospitalRegisterDto dto = new HospitalRegisterDto();
        dto.setServerKey(getServerKey());
        dto.setServerSecret(getServerSecret());
        return dto;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("id", getId())
            .append("serverKey", getServerKey())
            .append("serverSecret", getServerSecret())
            .append("serverName", getServerName())
            .append("serverUrl", getServerUrl())
            .append("recordState", getRecordState())
            .toString();
    }
}
